//
//  WQStatusListViewModel.swift
//  WeiBo
//
//  Created by 张德华 on 7/29/16.
//  Copyright © 2016 ZhangDeHua. All rights reserved.
//

import UIKit

class WQStatusListViewModel: NSObject {
    
    /**全局的ViewModel数组*/
    lazy var statusList: [WQStatusViewModel] = [WQStatusViewModel]()
    
    
}


// MARK: - ************微博首页
extension WQStatusListViewModel {
    
    func loadHomeData(isPullUp: Bool, isFinish:(isSuc: Bool, count: Int) -> ()) {
        
        
        var maxId:Int64 = 0
        var sinceId: Int64 = 0
        
        
        WQNetworkTools.sharedManager.homeLoadData(maxId, maxId: sinceId) { (result) in
            
            guard let res = result?["statuses"] as?[[String: AnyObject]] else{
                return
            }
            
            var tempArray:[WQStatusViewModel] = [WQStatusViewModel]()
             
            for dict in res {
            
                let status = WQStatus(dict: dict)
            
                let statusViewModel = WQStatusViewModel(status:status)
                
                tempArray.append(statusViewModel)
                
            }
            
        }
        
        
    }
}